{% extends "layout.html" %}
{% block body %}
<body>
    <script type="text/javascript" charset="utf-8">
        $.util.namespace("user");
        $(function () {
            user.fmUserSearch=$("#fmUserSearch").form();
            user.dgUser=$("#dgUser").datagrid({
                url: 'sysUser.json',
                pagination: true,
                border: false,
                fit: true,
                fitColumns: true,
                striped: true,
                singleSelect: true,
                selectOnCheck: false,
                checkOnCheck: false,
                method: 'get',
                sortName: 'u_id',
                sortorder: 'asc',
                toolbar: '#toolbarUser',
                pageSize: 20,
                pageList: [10,20,50],
                nowarp: true,
                idField: 'u_id',
                columns: [ [ {
                    field: 'ck',
                    checkbox: true
                },{
                    title: 'ID',
                    sortable: true,
                    field: 'u_id'
                },{
                    title: '帐号',
                    sortable: true,
                    field: 'u_user'
                },{
                    title: '姓名',
                    sortable: true,
                    field: 'u_name'
                },{
                    title: '上次登录',
                    sortable: true,
                    field: 'u_lastlogin'
                } ] ]
            });

            $("#searchUser").click(function(){
                user.dgUser.datagrid('load',
{#                    u_user: $("#fmUserSearch").find('[name=u_user]').val()#}
                    user.fmUserSearch.serializeObject()
                );

            });
            $("#clearUser").click(function(){
                user.dgUser.datagrid('load', {});
                user.fmUserSearch[0].reset();
            });


        });
    </script>
    <div class="easyui-layout" data-options="fit:true">
        <div title="DataGrid" data-options="region: 'center', border: false, noheader: true">
            <table id="dgUser"
{#                class="easyui-datagrid"#}
{#                data-options="#}
{#                    fit: true,#}
{#                    fitColumns: true,#}
{#                    toolbar: toolbar,#}
{#                    border: false,#}
{#                    striped: true,#}
{#                    singleSelect: true,#}
{#                    rownumbers: true,#}
{#                    pagination: true,#}
{#                    selectOnCheck: false,#}
{#                    checkOnSelect: false,#}
{#                    url: 'sysUser.json',#}
{#                    method: 'get',#}
{#                    sortName: 'u_id',#}
{#                    sortOrder: 'asc'#}
{#                    "#}
            >
{#                <thead>#}
{#                    <tr>#}
{#                        <th data-options="field:'ck',checkbox:true"></th>#}
{#                        <th data-options="field:'u_id'" sortable="true">ID</th>#}
{#                        <th data-options="field:'u_user'" sortable="true">帐号</th>#}
{#                        <th data-options="field:'u_name'" sortable="true">姓名</th>#}
{#                        <th data-options="field:'u_lastlogin'" sortable="true">上次登录</th>#}
{#                    </tr>#}
{#                </thead>#}
            </table>
        </div>
    </div>
    <div id="toolbarUser" class="datagrid-toolbar">
        <form id="fmUserSearch">
            <table>
                <tr>
                    <td>帐号</td>
                    <td><input name="u_user" /></td>
                    <td>姓名</td>
                    <td><input name="u_name" /></td>
                    <td>登录时间</td>
                    <td><input name="lastloginStart" class="easyui-datetimebox" editable="false" /></td>
                    <td><input name="lastloginEnd" class="easyui-datetimebox" editable="false" /></td>
                    <td><a href="#" id="searchUser" class="easyui-linkbutton" plain="false" iconCls="icon-search">查询</a></td>
                    <td><a href="#" id="clearUser" class="easyui-linkbutton" plain="false" iconCls="icon-reload">清空</a></td>
                </tr>
            </table>
        </form>
    </div>
</body>
{% endblock %}